package com.aaa.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaCheckRole;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试权限注解
 */
@RestController("/role/")
public class SaRoleController {

    @GetMapping("admin-a")
    @SaCheckRole("adminA")
    public String adminA(){
        return "已有adminA权限";
    }
    @GetMapping("admin-b")
//    @SaCheckRole("A")
    public String adminB(){
        return "adminB";
    }

    @GetMapping("user-a")
    @SaCheckPermission("area1.power3")
    public String userA(){
        return "userA";
    }
    @GetMapping("user-b")
    public String userB(){
        return "userB";
    }
    @GetMapping("user-c")
    public String userC(){
        return "userC";
    }
    @GetMapping("user-d")
    public String userD(){
        return "userD";
    }

}
